import { createContext, useContext } from "react";

interface ModelContext {
	key: symbol;
}

export const ModalContext = createContext<ModelContext | null>(null);

export function useModalContext() {
	const context = useContext<ModelContext | null>(ModalContext);
	if (!context) {
		throw new Error("useModalContext must be used within a ModalContext");
	}
	return context;
}
